<?php

class List_onlinesupport extends Controller {	
	
	function List_onlinesupport(){
		parent::Controller();
		$this->common_model->checklogin();
		$this->load->model('onlinesupport_model');
	}	
	function index(){					
		$this->_loadview();
	}
	function addnew(){
		$this->onlinesupport_model->addnew();
		$this->_loadview_addnew();
	}
	function delete(){
		$this->onlinesupport_model->delete();
		$this->_loadview();
	}
	function update($id=''){
		$this->onlinesupport_model->update();
		$this->_loadview_update($id);
	}
	function save(){
		$this->onlinesupport_model->save();
		$this->_loadview();
	}	
	function _loadview(){		
		$data = $this->common_model->general();
		$data['bodyview'] = 'onlinesupport/list';	
		$data['datagrid'] = $this->onlinesupport_model->getdatasource();
		$this->load->view('mastertemplate',$data);
	}
	function _loadview_addnew(){
		$data = $this->common_model->general();
		$data['bodyview'] = 'onlinesupport/addnew';
		$data['profile']  = $this->onlinesupport_model->getnewprofile();	
		$this->load->view('mastertemplate',$data);
	}
	function _loadview_update($id){
		$data = $this->common_model->general();
		$data['bodyview'] = 'onlinesupport/update';		
		$res = $this->onlinesupport_model->getuserprofile($id);
		if($res===FALSE) redirect('list_onlinesupport','location');
		$data['info'] = $res;
		$this->load->view('mastertemplate',$data);
	}
}

/* End of file usermanagement.php */
/* Location: ./system/application/admin/controllers/usermanagement.php */